package app.auto.runner.base.action;

import android.app.Activity;
import android.view.View;

import app.auto.runner.base.utility.ToastUtil;

/**
 * Created by admin on 2017/9/3.
 */

public class ClickAction implements View.OnClickListener {
    Actions actions;

    @Override
    public void onClick(View view) {
        if (actions == null) {
            if (view.getTag() == null) {
                return;
            }
            String tag = view.getTag().toString();
            if (!view.getTag().toString().contains("saveUI();")) {
                tag = "saveUI();" + tag;
            }
            actions = Actions.withView(view).parse(tag);
        }
        Activity acty = ((Activity) view.getContext());

        actions.action();
    }
}
